import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

class MyCircularQueue{
    public int[] elem;
    public int front;
    public int rear;
    public MyCircularQueue(int k){


    }
}
/*class Node{
    public int val;
    public Node next;
    public Node(int val){
        this.val = val;
    }
}
class MyQueue{
    public Node head;
    public Node last;

    public void offer(int val){
        Node node = new Node(val);
        if(head == null){
            head = node;
            last = node;
        }else {
            last.next = node;
            last = last.next;

        }
    }
    public int poll(){
        if (isEmpty()){
            throw new RuntimeException();
        }
        int oldVal = head.val;
        this.head = head.next;
        return oldVal;
    }
    public boolean isEmpty(){
        return this.head == null;
    }
    public int peek(){
        if (isEmpty()){
            throw new RuntimeException();
        }
        int oldVal = head.val;
        return oldVal;
    }
}*/
class Node{
    public int val;
    public Node next;
    public Node(int val){
        this.val = val;
    }

}
class MyQueue{
    public Node head;
    public Node last;

    public void offer(int val){
        Node node = new Node(val);
        if (head == null){
            head = node;
            last = node;
        }
        last.next = node;
        last = last.next;


    }
    public int poll(){
        if (isEmpty()){
            return  -1;
        }
        int oldVal = head.val;
        this.head = head.next;
        return oldVal;

    }
    public boolean isEmpty(){
        return this.head == null;

    }
    public int peek(){
        if (isEmpty()){
            return  -1;
        }
        int oldVal = head.val;
        //this.head = head.next;
        return oldVal;

    }


}
public class Test0822 {
    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        Deque<Integer> deque = new LinkedList<>();
        LinkedList<Integer> linkedList = new LinkedList<>();
    }
}

